#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
花生tg群发软件启动脚本
"""

import sys
import os

def check_dependencies():
    """检查依赖项是否已安装"""
    try:
        import telethon
        print("✓ Telethon库已安装")
    except ImportError:
        print("✗ 缺少Telethon库，正在安装...")
        os.system("pip install telethon")
        
    try:
        import tkinter
        print("✓ Tkinter库已安装")
    except ImportError:
        print("✗ 缺少Tkinter库，请安装Python的tkinter模块")

def main():
    """主函数"""
    print("=" * 50)
    print("花生tg群发")
    print("=" * 50)
    
    # 检查依赖项
    check_dependencies()
    
    print("\n正在启动程序...")
    
    # 导入并运行主程序
    try:
        from telegram_mass_sender import main as run_app
        run_app()
    except ImportError as e:
        print(f"导入错误: {e}")
        print("请确保telegram_mass_sender.py文件存在")
    except Exception as e:
        print(f"启动错误: {e}")

if __name__ == "__main__":
    main() 